import java.util.*;
public class EX15_5{
	public static void main(String args[]) {
		List<Integer> list = new LinkedList<Integer>();
		for(int i =10;i<=50;i=i+10)
			list.add(new Integer(i));
		list.add(new Integer(5126));
		list.add(new Integer(5127));
		list.add(new Integer(5128));
		System.out.println("洗牌前，链表中的数据");
		Iterator<Integer> iter = list.iterator();
		while(iter.hasNext()) {
			Integer n = iter.next();
			System.out.printf("%d\t",n.intValue());
		}
		Collections.shuffle(list);
		System.out.printf("\n洗牌后，数据为：\n");
		iter=list.iterator();
		while(iter.hasNext()){
			Integer n = iter.next();
			System.out.printf("%d\t",n.intValue());
		}
		Collections.shuffle(list);
       System.out.printf("\n洗牌后,链表中的数据\n");
       iter=list.iterator();
       while(iter.hasNext()){
          Integer n=iter.next();
          System.out.printf("%d\t",n.intValue());
       }
       System.out.printf("\n再向右旋转1次后,链表中的数据\n");
       Collections.rotate(list,1);
       iter=list.iterator();
       while(iter.hasNext()){
          Integer n=iter.next();
          System.out.printf("%d\t",n.intValue());
       }

    }
}

